#!/usr/bin/python
# -*- coding: UTF-8 -*-
def anagrams(s,l):  
    list1 = []
    for i in range(len(l)):
        if(sorted(list(s)) == sorted(l[i])):
            list1.append(l[i])
    return list1
print anagrams('abba', ['aabb', 'abcd', 'bbaa', 'dada'])
print anagrams('racer', ['crazer', 'carer', 'racar', 'caers', 'racer'])
print anagrams('laser', ['lazing', 'lazy',  'lacer'])